Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: fix doc build targets #35060

Closed
wants to merge 1 commit into from
Closed

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Sep 4, 2020

Adds doc output directory as order-only prerequisite for build target.

Currently, here is the issue:

$ make docclean > /dev/null
$ make out/doc/api/addons.html > /dev/null
internal/fs/utils.js:298
    throw err;
    ^

Error: ENOENT: no such file or directory, open 'out/doc/apilinks.json'
    at Object.openSync (fs.js:465:3)
    at Object.writeFileSync (fs.js:1416:35)
    at Object.<anonymous> (…/tools/doc/apilinks.js:211:4)
    at Module._compile (internal/modules/cjs/loader.js:1090:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1111:10)
    at Module.load (internal/modules/cjs/loader.js:955:32)
    at Function.Module._load (internal/modules/cjs/loader.js:796:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: 'out/doc/apilinks.json'
}
make: *** [out/doc/apilinks.json] Error 1
$ mkdir out/doc
$ make out/doc/api/addons.html > /dev/null
[Error: ENOENT: no such file or directory, open 'out/doc/api/addons.html'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'out/doc/api/addons.html'
}
[Error: ENOENT: no such file or directory, open 'out/doc/api/addons.json'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'out/doc/api/addons.json'
}
make: *** [out/doc/api/addons.html] Error 1

The problem is that the out/doc/api directory is not created before trying to generate the files, which fails. This PR adds the directories as prerequisites to ensure the files can be generated.

Repported by @DerekNonGeneric in #34986 (comment).

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the build Issues and PRs related to build files or the CI. label Sep 4, 2020
@DerekNonGeneric
Copy link
Contributor

I just applied this patch to my fork and here's the error:

if [ -x /mnt/c/orgs/nodejs/node-runtime/./node ] && [ -e /mnt/c/orgs/nodejs/node-runtime/./node ]; then /mnt/c/orgs/nodejs/node-runtime/./node  tools/doc/versions.js out/previous-doc-versions.json; elif [ -x `which node` ] && [ -e `which node` ] && [ `which node` ]; then `which node`  tools/doc/versions.js out/previous-doc-versions.json; else echo "No available node, cannot run \"node  tools/doc/versions.js out/previous-doc-versions.json\""; exit 1; fi;
make: *** No rule to make target 'out/doc/', needed by 'out/doc/apilinks.json'.  Stop.

@aduh95
Copy link
Contributor Author

aduh95 commented Sep 4, 2020

@DerekNonGeneric Bummer, I don't have this error (I'm using GNU Make 3.81 built for i386-apple-darwin11.3.0, I suspect there are small differences with your version).

Makefile Outdated Show resolved Hide resolved
@DerekNonGeneric
Copy link
Contributor

I'm still missing the out/doc/api/assets folder. These docs are served w/o any styles.

Adds doc output directory as order-only prerequisite for build target.
@aduh95 aduh95 force-pushed the fix-make-doc-targets branch from 292458c to 1e05cc6 Compare September 4, 2020 23:45
Copy link
Contributor

@DerekNonGeneric DerekNonGeneric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#35060 (comment) resolved by #34986 (comment), so everything seems to be working as expected now.

This will need to land before #34986 otherwise doc workflow will be broken on master branch.

@DerekNonGeneric DerekNonGeneric added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Sep 4, 2020
DerekNonGeneric pushed a commit that referenced this pull request Sep 6, 2020
Adds doc output directory as order-only prerequisite for build target.

PR-URL: #35060
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
@DerekNonGeneric
Copy link
Contributor

Landed in 8ae2f47

@aduh95 aduh95 deleted the fix-make-doc-targets branch September 6, 2020 20:40
richardlau pushed a commit that referenced this pull request Sep 7, 2020
Adds doc output directory as order-only prerequisite for build target.

PR-URL: #35060
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
@richardlau richardlau mentioned this pull request Sep 7, 2020
4 tasks
richardlau pushed a commit that referenced this pull request Sep 7, 2020
Adds doc output directory as order-only prerequisite for build target.

PR-URL: #35060
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
addaleax pushed a commit that referenced this pull request Sep 22, 2020
Adds doc output directory as order-only prerequisite for build target.

PR-URL: #35060
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
addaleax pushed a commit that referenced this pull request Sep 22, 2020
Adds doc output directory as order-only prerequisite for build target.

PR-URL: #35060
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
@codebytere codebytere mentioned this pull request Sep 28, 2020
joesepi pushed a commit to joesepi/node that referenced this pull request Jan 8, 2021
Adds doc output directory as order-only prerequisite for build target.

PR-URL: nodejs#35060
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. build Issues and PRs related to build files or the CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants